package ControlLayer;
import ModelLayer.Manufacturer;
import DBLayer.DBManufacturer;
import java.util.ArrayList;

public class CtrManufacturer {
    // <editor-fold defaultstate="collapsed" desc="Attributes & Constructors">
    private static CtrManufacturer instance = null;
    DBManufacturer dbManufacturer = new DBManufacturer();

    public CtrManufacturer() {
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Methods">
    public static CtrManufacturer getInstance() {
        if (instance == null) {
            instance = new CtrManufacturer();
        }
        return instance;
    }

    public ArrayList<Manufacturer> getManufacturerList() {
        return dbManufacturer.getManufacturerList();
    }

    public Manufacturer getManufacturerByID(int id) {
        return dbManufacturer.getManufacturerByID(id);
    }

    public int addManufacturer(Manufacturer manufacturer) {
        return dbManufacturer.addManufacturer(manufacturer);
    }

    public int updateManufacturer(Manufacturer manufacturer, int id) {
        return dbManufacturer.updateManufacturer(manufacturer, id);
    }

    public void deleteManufacturer(int id) {
        dbManufacturer.deleteManufacturer(id);
    }
    // </editor-fold>
}
